// ManagedSail.h

#pragma once

#include <sail.h>
#include "SailConfig.h"

using namespace System;

namespace ManagedSail {
	
	public enum class SwapBufferMode
	{
		Blocking = 1,
		NonBlocking = 2,
		Backward = 4
	};

	public ref class Sail
	{
	private:
		sail* _sail;

	public:
		Sail();
		virtual ~Sail()
			{ delete _sail; Release(); }
		!Sail()
			{ delete _sail; Release(); }
		

		IntPtr GetBuffer();
		void SwapBuffer(SwapBufferMode swapMode);

//		void Init(SailConfig^ conf);
		void Init(String ^path,int resX,int resY);
		void Shutdown();

	protected:
		virtual void Release();

	};	
}
